﻿using System.IO;
using System.Security.Cryptography.X509Certificates;
using System.Web;

namespace Inovout.Cloud.Web
{
    public class OAuthX509Certificates
    {
        private OAuthX509Certificates()
        {
        }
        private static readonly OAuthX509Certificates instance;
        static OAuthX509Certificates()
        {
            instance = new OAuthX509Certificates
            {
                EncryptionCertificate = new X509Certificate2(Path.Combine(HttpRuntime.AppDomainAppPath, "Configs/Encryption.pfx"), "a", X509KeyStorageFlags.MachineKeySet),
                SigningCertificate = new X509Certificate2(Path.Combine(HttpRuntime.AppDomainAppPath, "Configs/Signing.pfx"), "a", X509KeyStorageFlags.MachineKeySet)
            };
        }
        public static OAuthX509Certificates Instance { get { return instance; } }
        public X509Certificate2 SigningCertificate { get; set; }
        public X509Certificate2 EncryptionCertificate { get; set; }

    }
}
